<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var num = 1;
        function img() {
            var img = document.getElementById("lb");
            img.src = "image/"+(++num==6?num=1:num)+".jpg";
        }
    </script>
</head>
<body onload="setInterval('img()',1000)">
<img id="lb" src="image/1.jpg" width="100%"/>

</body>
</html>